*** Settings ***
Library     SeleniumLibrary
Library     Collections
Library     lib.py
Library     BuiltIn

*** Variables ***
${BROWSER}    Chrome
${URL}    https://www.baidu.com
${MIN}      0
${MAX}      2

*** Test Cases ***
Open Browser And Go To Example
    Open Browser     ${URL}     ${BROWSER}
    Maximize Browser Window
    ${kw_list}=    Create List    
    Append To List    ${kw_list}    杨幂
    Append To List    ${kw_list}    李易峰
    Append To List    ${kw_list}    杨幂粉丝
    Log    ${kw_list}
    FOR     ${index}    IN RANGE    10
        ${random_number}=    Generate Random Number    0    2
        Log     ${random_number}
    END

Open Browser And Add branch
    Open Browser    ${URL}    ${BROWSER}
    Maximize Browser Window
    ${kw_locator}=    Set Variable    id=kw
    ${kw_exist}=    Run Keyword And Return Status    Wait Until Element Is Visible     ${kw_locator}
#    IF    $kw_exist
#        Log    元素存在
#    ELSE
#        Log    元素不存在
#    END
#
    IF    not $kw_exist
        Log    百度搜索框不存在
    END

Test Condition
    ${a}=    Set Variable    ${0}
#    IF    $a
#        Log    helllo
#    END
    ${b}=    Set Variable    ${4}
#    IF  $a  and  $b
#            Log  都为真
#    END
    IF  $a and $b
        Log    有一个元素为真
    END
#    Capture Element Screenshot

Test range
    FOR    ${index}    IN RANGE    4
        IF    $index==2
            Log    11
            Exit For Loop
        END
    END

    